package tacocloud.dao;

import lombok.Data;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import java.util.Date;
import java.util.List;

/**
 * @NotNull和@Size需要导入依赖
 * <dependency>
 *      <groupId>org.springframework.boot</groupId>
 *      <artifactId>spring-boot-starter-validation</artifactId>
 * </dependency>
 */

@Data
public class Taco {

    private Long id;

    private Date createAt;

    @NotNull    // 名字非空
    @Size(min=5,message="Name must be at least 5 characters long")  // 名字长度不小于5
    private String name;

    @Size(min=1,message="You must choose at least 1 ingredient")    // 选择内容不小于1个
    private List<String> ingredients;
}
